﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Alex.Library.Cloud.Libs;

namespace Alex.Library.Cloud.Citrix.VMMParameters
{
    public class CreateVMParameter : AsyncVMMParameter
    {
        public string template_uuid { get; set; }

        public string new_vm_name { get; set; }

        public bool need_full_copy { get; set; }

        public string sr_uuid { get; set; }

        public override bool IsValid()
        {
            bool isvalid = true;
            
            if (String.IsNullOrEmpty(template_uuid))
            {
                this._errorMessage.AppendLine("template_uuid is empty or null.");
                isvalid = false;
            }
            if (String.IsNullOrEmpty(new_vm_name))
            {
                this._errorMessage.AppendLine("new_vm_name is empty or null.");
                isvalid = false;
            }
            if (need_full_copy && String.IsNullOrEmpty(sr_uuid))
            {
                this._errorMessage.AppendLine("sr_uuid is empty or null.");
                isvalid = false;
            }
            
            return isvalid;
        }                
    }
}
